﻿using System.Collections.Generic;

public class GameModel {
	// === Public =====================================================================================================
	public List<ElementCtrl> Elements { get; private set; }

	public GameModel() {
		Elements = new List<ElementCtrl>();
	}
	
	public void AddElement(params ElementCtrl[] elements) {
		Elements.AddRange(elements);
	}

	public void RemoveElement(ElementCtrl element) {
		Elements.Remove(element);
	}

	public void AddElement(List<Element> elements) {
		AddElement(elements.ToArray());
	}
	
	public void AddElement(params Element[] elements) {
		foreach (var element in elements) {
			if (element.ElementType.Equals(ElementType.Tile)) {
				Elements.Add(Creators.Element.Create(new PropertyElementTile(element.Position, element.TexturePath)));
			} else if (element.ElementType.Equals(ElementType.Wall)) {
				Elements.Add(Creators.Element.Create(new PropertyElementWall(element.Position, element.TexturePath)));
			}
		}
	}
}
